import request from '@/utils/request';
import Constants from '@/utils/constants';

const serviceName = 'module';

export async function queryList(params) {
  return request(`${Constants.SERVICE_ROOT}/adapi/${serviceName}/querylist`, {
    method: 'POST',
    data: {
      ...params,
    },
  });
}

export async function addModule(params) {
  return request(`${Constants.SERVICE_ROOT}/adapi/${serviceName}/add`, {
    method: 'POST',
    data: {
      ...params,
    },
  });
}

export async function updateModule(params) {
  return request(`${Constants.SERVICE_ROOT}/adapi/${serviceName}/update`, {
    method: 'POST',
    data: {
      ...params,
    },
  });
}

export async function deleModule(params) {
  return request(`${Constants.SERVICE_ROOT}/adapi/${serviceName}/delete`, {
    method: 'POST',
    data: {
      ...params,
    },
  });
}

export async function moduleDetail(params) {
  return request(`${Constants.SERVICE_ROOT}/adapi/${serviceName}/detail`, {
    method: 'POST',
    data: {
      ...params,
    },
  });
}
